#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}
//取消按钮
void MainWindow::on_exitBtn_clicked()
{

}
//确认按钮
void MainWindow::on_loginBtn_clicked()
{
    if(ui->usrLineEdit->text()==tr("1234")&&ui->pwdLineEdit->text()==tr("1234")){
        this->close();
    }else {
        QMessageBox::warning(this, tr("Waring"),
                             tr("user name or password error!"),
                             QMessageBox::Yes);
        // 清空内容并定位光标
        ui->usrLineEdit->clear();
        ui->pwdLineEdit->clear();
        ui->usrLineEdit->setFocus();
    }

}
